package com.wy.mybatisrepo;

import com.wy.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserMybatisService {
    @Autowired
    private UserMapper userMapper;

    @Cacheable(key = "methodName",value = "users")
    public List<User> findAll(){
        System.out.println("请求来了=====");
        return userMapper.findAll();
    }
}
